#include <glib/gi18n-lib.h>
#include <meta/display.h>
+#include <meta/meta-context.h>
#include <meta/meta-workspace-manager.h>
#include <meta/meta-x11-display.h>
return TRUE;
}
+static void
+child_context_setup (gpointer user_data)
+{
+ ShellGlobal *shell_global = user_data;
+ MetaContext *meta_context;
+
+ g_object_get (shell_global, "context", &meta_context, NULL);
+ meta_context_restore_rlimit_nofile (meta_context, NULL);
+}
+
#if !defined(HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS) && defined(HAVE_SYSTEMD)
/* This sets up the launched application to log to the journal
* using its own identifier, instead of just "gnome-session".
const char *appid = user_data;
int res;
int journalfd = sd_journal_stream_fd (appid, LOG_INFO, FALSE);
+ ShellGlobal *shell_global = shell_global_get ();
+
if (journalfd >= 0)
{
do
while (G_UNLIKELY (res == -1 && errno == EINTR));
(void) close (journalfd);
}
+
+ child_context_setup (shell_global);
}
#endif
gboolean ret;
GSpawnFlags flags;
gboolean discrete_gpu = FALSE;
+ ShellGlobal *shell_global = shell_global_get ();
if (app->info == NULL)
{
ret = g_desktop_app_info_launch_uris_as_manager_with_fds (app->info, NULL,
context,
flags,
- NULL, NULL,
+ child_context_setup, shell_global,
wait_pid, NULL,
-1,
journalfd,
#ifdef HAVE_SYSTEMD
app_child_setup, (gpointer)shell_app_get_id (app),
#else
- NULL, NULL,
+ child_context_setup, shell_global,
#endif
wait_pid, NULL,
error);